from dc_shop.core.models.dto import DiscountDTO
from dc_shop.database.uow import SQLAlchemyUoW


class DiscountService:
    def __init__(self, uow: SQLAlchemyUoW):
        self._uow = uow

    async def get_discount_by_category_and_shop(
        self, category_id: int, shop_id: int, product_count: int
    ) -> DiscountDTO | None:
        """Получаем скидку по категории и магазину"""

        return await self._uow.discount_repo.get_discount_by_category_and_shop(category_id, shop_id, product_count)
